<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:10px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; font-weight:600;">VBA Excel. Имитация движения и кликов мыши</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Имитация движения и кликов левой и правой кнопками мыши из кода VBA Excel. Эмуляция перемещения курсора и определение его текущих координат.</span></p>
<p style=" margin-top:32px; margin-bottom:6px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#fafafa;"><span style=" font-weight:600; color:#333333;">Содержание</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/imitatsiya-dvizheniya-i-klikov-myshi/#Opredelenie_koordinat_kursora"><span style=" text-decoration: underline; color:#0000ff;">1. Определение координат курсора</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/imitatsiya-dvizheniya-i-klikov-myshi/#Imitacia_dvizenia_mysi"><span style=" text-decoration: underline; color:#0000ff;">2. Имитация движения мыши</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/imitatsiya-dvizheniya-i-klikov-myshi/#Imitacia_klikov_mysi"><span style=" text-decoration: underline; color:#0000ff;">3. Имитация кликов мыши</span></a></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">В VBA Excel нет методов и функций для имитации движения мыши и эмуляции кликов ее левой и правой кнопками. Но для этих целей, а также для определения текущих координат курсора, можно использовать встроенные функции Windows API — GetCursorPos, SetCursorPos и mouse_event.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_1_host"></a>Если эти функции Windows API объявить без ключевого слова Private, они будут доступны во всех <a href="https://vremya-ne-zhdet.ru/vba-excel/modul-protsedura-forma/"><span style=" text-decoration: underline; color:#0000ff;">модулях</span></a> текущего проекта VBA.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Opredelenie_koordinat_kursora"></a><span style=" font-size:x-large; font-weight:600;">О</span><span style=" font-size:x-large; font-weight:600;">пределение координат курсора</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Определение текущих координат курсора из кода VBA Excel:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">2</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">3</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">4</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">5</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">6</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">7</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">8</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">9</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">10</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">11</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">12</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">13</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">O</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ption</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Explicit</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">eclare</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">PtrSafe </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Function</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">GetCursorPos </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Lib</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;user32&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">lpPoint </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">POINTAPI</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">T</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">ype </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">POINTAPI</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">  </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">X</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">  </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Y</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Type</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;"> </span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Get_Cursor</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Dim</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myPoint </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">POINTAPI</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">GetCursorPos myPoint</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-11"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Debug</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Print</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Координата X: &quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myPoint</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">X</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">vbNewLine</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">_</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-12"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;Координата Y: &quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myPoint</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Y</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp; </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">vbNewLine</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836a0041904562-13"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></pre></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_2_host"></a>Скопируйте представленный выше код в стандартный модуль и кликните мышью внутри процедуры <span style=" font-family:'Courier New'; color:#333333; background-color:#d0effb;">Get_Cursor()</span>. Затем, перемещайте курсор мыши по экрану, не нажимая кнопок, чтобы мигающая вертикальная линия (точка вставки) не ушла из процедуры, и нажимайте клавишу F5. В окне Immediate будут печататься текущие координаты курсора. Клавишу F5 можно нажимать одновременно с процессом перемещения мыши. Значения координат X и Y отображаются в пикселях.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Imitacia_dvizenia_mysi"></a><span style=" font-size:x-large; font-weight:600;">И</span><span style=" font-size:x-large; font-weight:600;">митация движения мыши</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Имитация движения мыши, а, точнее, перескока мыши из одной точки в другую, осуществляется из кода VBA Excel путем задания новых координат курсору:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">2</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">3</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">4</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">5</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">6</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">7</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">8</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">9</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">10</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">O</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ption</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Explicit</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">eclare</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">PtrSafe </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Function</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">SetCursorPos </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Lib</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;user32&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">X</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Y</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;"> </span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Set_Cursor</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Dim</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myX </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myY </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myX</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">600</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myY</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">400</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'Задаем курсору новые координаты</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">SetCursorPos </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">myX</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">myY</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836b2190987104-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></pre></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_3_host"></a>Переменные добавлены в пример для наглядности, их можно не использовать:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836bb332360867"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836bb332360867-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">etCursorPos</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">600</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">400</span></pre></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">А так можно задать множественные перескоки курсора мыши:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">2</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">3</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">4</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">5</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">6</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">7</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Many_Set_Cursor</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">For</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">600</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Step</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">20</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Application</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Wait </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">Now</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> + </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">TimeValue</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;0:00:01&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">SetCursorPos</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">i</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Next</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836be056772443-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></pre></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Здесь перескок мыши происходит один раз в секунду.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Уменьшив задержку выполнения цикла предыдущего примера с помощью другого цикла, можно ускорить перемещение курсора и сделать его более плавным:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">2</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">3</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">4</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">5</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">6</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">7</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">8</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">9</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Many_Set_Cursor_2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">i2 </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">For</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">600</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">For</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">100000</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">a</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i2</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> / </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">2</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Next</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">SetCursorPos</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">i</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Next</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836c2404355071-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></pre></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Здесь уже более похоже на имитацию движения мыши.</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Imitacia_klikov_mysi"></a><span style=" font-size:x-large; font-weight:600;">И</span><span style=" font-size:x-large; font-weight:600;">митация кликов мыши</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Чтобы воспроизвести имитацию кликов левой и правой кнопками мыши, нам понадобятся коды событий кнопок мыши:</p>
<table border="1" style=" margin-top:0px; margin-bottom:20px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0"><thead>
<tr>
<td width="60%" bgcolor="#eaeaea" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:10;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; background-color:#eaeaea;">Событие</span></p></td>
<td width="40%" bgcolor="#eaeaea" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:10;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; background-color:#eaeaea;">Код</span></p></td></tr></thead>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">Нажать левую кнопку</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">&amp;H2</span></p></td></tr>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">Отпустить левую кнопку</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">&amp;H4</span></p></td></tr>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">Нажать правую кнопку</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">&amp;H8</span></p></td></tr>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">Отпустить правую кнопку</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" background-color:#fff7ec;">&amp;H10</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Следующий пример показывает, как установить курсор мыши в заданное место экрана и сымитировать клик правой кнопкой мыши:</p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:15px; font-family:'Verdana,Arial,sans'; font-size:12px; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">1</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">2</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">3</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">4</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">5</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">6</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">7</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">8</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">9</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">10</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#5499de;">11</span></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#c8e1fa;"><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#317cc5; background-color:#c8e1fa;">12</span></p></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-1"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">O</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ption</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Explicit</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-2"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">eclare</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">PtrSafe </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Function</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">SetCursorPos </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Lib</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;user32&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">X</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">Y</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-3"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">eclare</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">PtrSafe </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">mouse_event </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Lib</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#008000;">&quot;user32&quot;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">dwFlags </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">dx </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">dy </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">cButtons </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ByVal</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">dwExtraInfo </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Long</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">)</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-4"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000; background-color:#f7f7f7;"> </span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-5"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#004ed0;">Set_Cursor_and_RightClick</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">()</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-6"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'Устанавливаем курсор в нужную точку экрана</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-7"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#000000;">SetCursorPos</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">800</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">600</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-8"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'Нажимаем правую кнопку мыши</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-9"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">mouse_event</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">H8</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-10"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ff8000;">'Отпускаем правую кнопку мыши</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-11"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">mouse_event</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> &amp;</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#002d7a;">H10</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#ce0000;">0</span></pre>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-64fa293c836cb363758445-12"></a><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:12px; font-weight:496; color:#800080;">Sub</span></pre></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="aswift_4_host"></a>Я выбрал для примера имитацию клика правой кнопкой мыши из-за большей наглядности (за счет отображения контекстного меню).</p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Обратите внимание, что функции Windows API, используемые в примерах, должны быть объявлены только один раз.</p>
<hr />
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Фразы для контекстного поиска: положение курсора, имитация клика, эмуляция клика, эмуляция движения, имитация мыши, эмуляция мыши, координаты мыши, расположение мыши, расположение курсора.</p></body></html>